The present invention relates to the generation of checksums, and in particular checksums for the TCP/UDP protocol.
Calculating a checksum is a simple way of testing data integrity. In a simple form, checksumming involves repetitively adding different pieces of data together to produce a checksum. The checksum is then transmitted with the data, and the data can be repetitively added again with the result being compared to the transmitted checksum. If they do not match, the data or the checksum has become corrupted.
A number of different checksum algorithms exist. For the TCP/UDP protocol (used over the Internet, for instance), after a pair of data are added, a carry bit, if there is one, is also added to the result. This is then summed with the next piece of data, and the process is repeated.
Historically, checksums were calculated in the CPU of a computer. Software would run a routine for loading the data, and then compute the sums, and looping through the data to be transmitted.
Subsequently, special purpose network cards were developed which could do the checksum calculation in hardware. This would off-load the burden from the CPU, and at the same time, enable faster calculation by using dedicated circuitry specifically designed for calculating the checksum. A disadvantage of using a network card is that the data is unprotected by the checksum between the CPU and the network card. Accordingly, this is a trade-off which is made.
More recently, more functions have been integrated into the microprocessor or CPU of a computer. As circuit integration has increased to give greater density, and more transistors on a microprocessor, more functions have been added. For example, in addition to processing data at a high rate of speed, some microprocessors now incorporate functions previously performed by special purpose hardware chips, such as graphics calculations.
It would be desirable to be able to use a microprocessor to calculate a checksum in a network application in order to ensure end-to-end security of the data. However, one disadvantage of performing such an operation in a microprocessor today is that microprocessors typically use one or more cache memories to speed up their operation. Since a checksum operation would involve additions of a large amount of data, that would typically use up a significant portion of the cache and overwrite other data necessary for other functions of the microprocessor.